package 用队列实现栈;

public class Test {
    public static void main(String[] args) {
        MyStack stack = new MyStack();
        stack.push(1);
        stack.push(2);
        stack.push(3);

        System.out.println("Top element is: " + stack.top()); // Expected: 3
        System.out.println("Popped element is: " + stack.pop()); // Expected: 3
        System.out.println("Top element is: " + stack.top()); // Expected: 2
        System.out.println("Is stack empty? " + stack.empty()); // Expected: false

        stack.pop();
        stack.pop();
        System.out.println("Is stack empty? " + stack.empty()); // Expected: true
    }
}
